/*
package cloud.xlh.infrastructure.file.ftp.operateimpl;

import cloud.xlh.infrastructure.file.ftp.config.FTPClient;
import cloud.xlh.infrastructure.file.operate.FileOperateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.File;

*
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/3/8 16:41
 * @ Description:


@Slf4j
@Service("FTP")
public class FTPOperateServiceImpl implements FileOperateService {

    @Autowired
    private FTPClient ftpClient;

    @Override
    public String upload(String fileName, String filePath, String bucketName) {
        return null;
    }

    @Override
    public void download(String bucketName, String fileName, HttpServletResponse response) {
        String programPath = System.getProperty("user.dir");
        String shellFilePath = "";
*
         * todo 需要一个脚本
         *

        shellFilePath = programPath + "/";
        log.info("脚本路径：{}", shellFilePath);

        String localPath = "";

        File file = new File(localPath);
        if (file != null && !file.exists()) {
            file.mkdirs();
        }

        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(stringBuffer);
        stringBuffer.append(" ");
        stringBuffer.append(ftpClient.getHost());
        stringBuffer.append(" ");
        stringBuffer.append(ftpClient.getUsername());
        stringBuffer.append(" ");
        stringBuffer.append(ftpClient.getPassword());
        stringBuffer.append(" ");
        stringBuffer.append(ftpClient.getLocalPath());
        stringBuffer.append(" ");
        stringBuffer.append(ftpClient.getRemoteDir());
        stringBuffer.append(" ");
        stringBuffer.append(fileName);

        log.info("shell脚本命令：" + stringBuffer.toString());

        int exitValue = 0;
        Process process;

        try {
            process = Runtime.getRuntime().exec(stringBuffer.toString());
            exitValue = process.waitFor();
        } catch (Exception e) {
            e.printStackTrace();
            log.error("call shell failed. error code is :" + exitValue);
            throw new RuntimeException(String.valueOf(exitValue));
        }
    }
}
*/
